<?php
// src/Asiah/SiklusBundle/Entity/Bookmark.php
namespace Asiah\SiklusBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @ORM\Entity(repositoryClass="Asiah\SiklusBundle\Repository\BookmarkRepository")
 * @ORM\Table(name="bookmark")
 */

class Bookmark {

	public function __construct() {
		$this -> setHates(0);
		$this -> setBookmarked(0);
		$this -> setCreatedDate(new \DateTime());
		$this -> setViewed(0);
		$this -> setLikes(0);
		$this -> tags = new ArrayCollection();
	}

	/**
	 * @ORM\Id
	 * @ORM\Column(type="integer")
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
	protected $id;
	/**
	 * @ORM\Column(type="integer")
	 */
	protected $viewed;
	/**
	 * @ORM\Column(type="integer")
	 */
	protected $bookmarked;
	/**
	 * @ORM\Column(type="integer")
	 */
	protected $hates;
	/**
	 * @ORM\Column(type="integer")
	 */
	protected $likes;
	/**
	 * @ORM\Column(type="string")
	 */
	protected $description;
	/**
	 * @ORM\Column(type="string")
	 */
	protected $title;
	/**
	 * @ORM\Column(type="string", nullable=true)
	 */
	protected $custom_url;
	/**
	 * @ORM\Column(type="date")
	 */
	protected $created_date;
	/**
	 * @ORM\ManyToOne(targetEntity="Link", inversedBy="bookmarks")
	 * @ORM\JoinColumn(name="link_id", referencedColumnName="id")
	 */
	protected $link;
	/**
	 * @ORM\ManyToOne(targetEntity="User", inversedBy="bookmarks")
	 * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
	 */
	protected $user;
	/**
	 * @ORM\ManyToMany(targetEntity="Tag", inversedBy="bookmarks")
	 * @ORM\JoinTable(name="bookmark_tags")
	 */
	protected $tags;
	/**
	 * @ORM\OneToMany(targetEntity="Comment", mappedBy="bookmark")
	 */
	protected $comments;
	/**
	 * Get id
	 *
	 * @return integer
	 */
	public function getId() {
		return $this -> id;
	}

	/**
	 * Set viewed
	 *
	 * @param integer $viewed
	 */
	public function setViewed($viewed) {
		$this -> viewed = $viewed;
	}

	/**
	 * Get viewed
	 *
	 * @return integer
	 */
	public function getViewed() {
		return $this -> viewed;
	}

	/**
	 * Set bookmarked
	 *
	 * @param integer $bookmarked
	 */
	public function setBookmarked($bookmarked) {
		$this -> bookmarked = $bookmarked;
	}

	/**
	 * Get bookmarked
	 *
	 * @return integer
	 */
	public function getBookmarked() {
		return $this -> bookmarked;
	}

	/**
	 * Set hates
	 *
	 * @param integer $hates
	 */
	public function setHates($hates) {
		$this -> hates = $hates;
	}

	/**
	 * Get hates
	 *
	 * @return integer
	 */
	public function getHates() {
		return $this -> hates;
	}

	/**
	 * Set likes
	 *
	 * @param integer $likes
	 */
	public function setLikes($likes) {
		$this -> likes = $likes;
	}

	/**
	 * Get likes
	 *
	 * @return integer
	 */
	public function getLikes() {
		return $this -> likes;
	}

	/**
	 * Set description
	 *
	 * @param string $description
	 */
	public function setDescription($description) {
		$this -> description = $description;
	}

	/**
	 * Get description
	 *
	 * @return string
	 */
	public function getDescription() {
		return $this -> description;
	}

	/**
	 * Set title
	 *
	 * @param string $title
	 */
	public function setTitle($title) {
		$this -> title = $title;
	}

	/**
	 * Get title
	 *
	 * @return string
	 */
	public function getTitle() {
		return $this -> title;
	}

	/**
	 * Set custom_url
	 *
	 * @param string $customUrl
	 */
	public function setCustomUrl($customUrl) {
		$this -> custom_url = $customUrl;
	}

	/**
	 * Get custom_url
	 *
	 * @return string
	 */
	public function getCustomUrl() {
		return $this -> custom_url;
	}

	/**
	 * Set created_date
	 *
	 * @param date $createdDate
	 */
	public function setCreatedDate($createdDate) {
		$this -> created_date = $createdDate;
	}

	/**
	 * Get created_date
	 *
	 * @return date
	 */
	public function getCreatedDate() {
		return $this -> created_date;
	}

	/**
	 * Set link
	 *
	 * @param Asiah\SiklusBundle\Entity\Link $link
	 */
	public function setLink(\Asiah\SiklusBundle\Entity\Link $link) {
		$this -> link = $link;
	}

	/**
	 * Get link
	 *
	 * @return Asiah\SiklusBundle\Entity\Link
	 */
	public function getLink() {
		return $this -> link;
	}

	/**
	 * Add tags
	 *
	 * @param Asiah\SiklusBundle\Entity\Tag $tags
	 */
	public function addTags(\Asiah\SiklusBundle\Entity\Tag $tags) {
		$this -> tags[] = $tags;
	}

	/**
	 * Get tags
	 *
	 * @return Doctrine\Common\Collections\Collection
	 */
	public function getTags() {
		return $this -> tags;
	}

	/**
	 * Set user
	 *
	 * @param Asiah\SiklusBundle\Entity\User $user
	 */
	public function setUser(\Asiah\SiklusBundle\Entity\User $user) {
		$this -> user = $user;  
	}

	/**
	 * Get user
	 *
	 * @return Asiah\SiklusBundle\Entity\User
	 */
	public function getUser() {
		return $this -> user;
	}

	/**
	 * Add comments
	 *
	 * @param Asiah\SiklusBundle\Entity\Comment $comments
	 */
	public function addComments(\Asiah\SiklusBundle\Entity\Comment $comments) {
		$this -> comments[] = $comments;
	}

	/**
	 * Get comments
	 *
	 * @return Doctrine\Common\Collections\Collection
	 */
	public function getComments() {
		return $this -> comments;
	}


    /**
     * Add tags
     *
     * @param Asiah\SiklusBundle\Entity\Tag $tags
     */
    public function addTag(\Asiah\SiklusBundle\Entity\Tag $tags)
    {
        $this->tags[] = $tags;
    }

    /**
     * Add comments
     *
     * @param Asiah\SiklusBundle\Entity\Comment $comments
     */
    public function addComment(\Asiah\SiklusBundle\Entity\Comment $comments)
    {
        $this->comments[] = $comments;
    }
}